const {ethers} = require("hardhat");
const {expect} = require("chai");

const initialSupply = 10000; // 10000 tokens with 18 decimals
let myTokenContract;
let account1,account2;
describe("test",async function () {
    this.beforeEach(async function () {
        
        [account1,account2] =await ethers.getSigners();
        const MyToken = await ethers.getContractFactory("MyToken");
        myTokenContract = await MyToken.deploy(initialSupply);
        const addr = await myTokenContract.getAddress();
        console.log(addr);
        expect(addr).to.be.properAddress;

    });
        it("test name",async ()=>{
            expect(await myTokenContract.name()).to.equal("MyToken");
            
        });
        
        it("test symbol",async ()=>{
            expect(await myTokenContract.symbol()).to.equal("MTK");
            
        });


        it("test decimals",async ()=>{
           expect(await myTokenContract.decimals()).to.equal(18);
            
        });

    // it("test transfer", async function () {
    //     expect(await myTokenContract.balanceOf(account1)).to.equal(initialSupply);
    //     await myTokenContract.transfer(account2, 1000)
    //     expect(await myTokenContract.balanceOf(account2)).to.equal(1000)
    // });
})